import { defineComponent, computed, unref, ref } from 'vue';
import Baz from './baz';
interface BazProps {
    msg: string;
}
const Zax = defineComponent({
    name: 'Zax', // 组件名
    props: {
        msg: {
            type: String,
            default: 'xxxxx'
        }
    },
    // props参数  {slots:插槽,attrs:v-bind参数 emit:回调函数}
    setup(props: BazProps) {
        const getProps = computed(() => {
            const propsObj = { ...props };
            return propsObj;
        });
        const { msg } = unref(getProps);

        const slots = {
            header: () => <span>我说是具名插槽</span>,
            footer: () => <span>我说是具名插槽11</span>
        };
        const items = ref(['苹果', '香蕉', '橙子']);
        const renderedItems = items.value.map((item, index) => (
            <li key={index}>{item}</li>
        ));
        return () => (
            <div>
                <ul>{renderedItems}</ul>
                <h1>{msg}标记符号</h1>
                <Baz v-slots={slots}>
                    呆呆呆呆呆呆呆呆地多多多多多多多
                </Baz>
            </div>
        );
    }
});
export default Zax;
